package com.mayikt.service.impl;

import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mayikt.http.SpringBeanContext;
/**
 * @Name MayiktLoginServiceImpl
 * @Author 枫火
 * @Date 2021/5/21 15:07
 * @Description
 **/
@RestController
public class MayiktLoginServiceImpl {

    @GetMapping("myLogin")
    public String myLogin() {
        System.out.println(">>myLogin threadName:" + Thread.currentThread().getName());
        // 获取cglib方式生成的代理类对象
        MayiktLoginServiceImpl mayiktLoginServiceImpl = (MayiktLoginServiceImpl) SpringBeanContext.getBean("mayiktLoginServiceImpl");
        mayiktLoginServiceImpl.myLoginService();
        return "myLogin";
    }

    @Async
    public void myLoginService() {
        System.out.println(">>myLoginService threadName:" + Thread.currentThread().getName());
    }
}
